package com.gf.gf_data.temp.dao;

import com.gf.gf_data.temp.entity.MtChartBarK1;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface MtChartBarK1Mapper {
    @Delete({
        "delete from mt_chart_bar_k1",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int deleteByPrimaryKey(Long id);

    @Insert({
        "insert into mt_chart_bar_k1 (id, datetime, ",
        "open, close, high, ",
        "low)",
        "values (#{id,jdbcType=BIGINT}, #{datetime,jdbcType=TIMESTAMP}, ",
        "#{open,jdbcType=DOUBLE}, #{close,jdbcType=DOUBLE}, #{high,jdbcType=DOUBLE}, ",
        "#{low,jdbcType=DOUBLE})"
    })
    int insert(MtChartBarK1 record);

    int insertSelective(MtChartBarK1 record);

    @Select({
        "select",
        "id, datetime, open, close, high, low",
        "from mt_chart_bar_k1",
        "where id = #{id,jdbcType=BIGINT}"
    })
    @ResultMap("BaseResultMap")
    MtChartBarK1 selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(MtChartBarK1 record);

    @Update({
        "update mt_chart_bar_k1",
        "set datetime = #{datetime,jdbcType=TIMESTAMP},",
          "open = #{open,jdbcType=DOUBLE},",
          "close = #{close,jdbcType=DOUBLE},",
          "high = #{high,jdbcType=DOUBLE},",
          "low = #{low,jdbcType=DOUBLE}",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(MtChartBarK1 record);
}